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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: C = None
        self.v: B = None
        self.x: A = None
        self.s: B = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: A = None
        self.z: B = None
        self.u: B = None
        self.y: D = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: F = None
        self.w: F = None
        self.q: F = None
        self.txt = txt

g = A("g")
c = B("c")
j = C("j")
e = D("e")
n = E("n")
k = F("k")
f = C("f")
d = F("d")

g.q = n
g.r = c
c.t = d
j.q = e
j.s = c
j.t = f
e.t = g
e.x = g
e.y = j
e.v = c
e.s = c
e.w = n
n.q = f
n.t = g
n.z = c
n.u = c
n.s = c
n.y = e
k.t = j
k.v = d
k.w = d
k.q = d
f.q = e
f.s = c
f.t = j
d.t = f
d.v = k
d.w = k
d.q = k
assert e.s.t.t.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: C = None
        self.v: B = None
        self.x: A = None
        self.s: B = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: A = None
        self.z: B = None
        self.u: B = None
        self.y: D = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: F = None
        self.w: F = None
        self.q: F = None
        self.txt = txt

g = A("g")
c = B("c")
j = C("j")
e = D("e")
n = E("n")
k = F("k")
f = C("f")
d = F("d")

g.q = n
g.r = c
c.t = d
j.q = e
j.s = c
j.t = f
e.t = g
e.x = g
e.y = j
e.v = c
e.s = c
e.w = n
n.q = f
n.t = g
n.z = c
n.u = c
n.s = c
n.y = e
k.t = j
k.v = d
k.w = d
k.q = d
f.q = e
f.s = c
f.t = j
d.t = f
d.v = k
d.w = k
d.q = k
assert e.s.t.t.s.t.txt == "d"