class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: B = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: G = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: E = None
        self.t: C = None
        self.txt = txt

b = A("b")
k = B("k")
a = C("a")
g = D("g")
h = E("h")
n = F("n")
l = G("l")
j = C("j")
f = A("f")

b.x = k
b.o = k
b.r = h
k.t = l
k.y = g
a.x = l
g.q = l
h.s = a
h.x = l
h.p = j
n.v = l
l.p = f
l.q = h
l.t = a
j.x = l
f.x = k
f.o = k
f.r = h
assert f.x.t.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: B = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: G = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: E = None
        self.t: C = None
        self.txt = txt

b = A("b")
k = B("k")
a = C("a")
g = D("g")
h = E("h")
n = F("n")
l = G("l")
j = C("j")
f = A("f")

b.x = k
b.o = k
b.r = h
k.t = l
k.y = g
a.x = l
g.q = l
h.s = a
h.x = l
h.p = j
n.v = l
l.p = f
l.q = h
l.t = a
j.x = l
f.x = k
f.o = k
f.r = h
assert f.x.t.t.x.txt == "l"