class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: B = None
        self.u: F = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: D = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

g = A("g")
j = B("j")
l = C("l")
i = D("i")
k = E("k")
e = F("e")
a = F("a")
n = C("n")
f = D("f")

g.t = e
g.u = e
g.y = j
g.w = f
j.u = a
j.t = f
j.x = i
l.x = a
l.p = f
l.u = g
i.z = g
i.q = k
k.z = i
e.v = f
a.v = f
n.x = a
n.p = i
n.u = g
f.z = g
f.q = k
assert f.z.w.q.z.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: B = None
        self.u: F = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: D = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

g = A("g")
j = B("j")
l = C("l")
i = D("i")
k = E("k")
e = F("e")
a = F("a")
n = C("n")
f = D("f")

g.t = e
g.u = e
g.y = j
g.w = f
j.u = a
j.t = f
j.x = i
l.x = a
l.p = f
l.u = g
i.z = g
i.q = k
k.z = i
e.v = f
a.v = f
n.x = a
n.p = i
n.u = g
f.z = g
f.q = k
assert f.z.w.q.z.q.z.txt == "i"