class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: D = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: C = None
        self.z: F = None
        self.y: D = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: D = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: E = None
        self.r: C = None
        self.txt = txt

d = A("d")
j = B("j")
b = C("b")
l = D("l")
n = E("n")
a = F("a")
g = D("g")
e = C("e")

d.t = a
d.r = g
j.p = a
j.w = l
j.s = b
b.t = a
b.z = a
b.p = e
b.y = l
b.u = n
l.w = a
n.x = l
n.p = l
n.r = a
a.y = l
a.q = n
a.r = b
g.w = a
e.t = a
e.z = a
e.p = b
e.y = g
e.u = n
assert e.u.p.w.q.r.q.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: D = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: C = None
        self.z: F = None
        self.y: D = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: D = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: E = None
        self.r: C = None
        self.txt = txt

d = A("d")
j = B("j")
b = C("b")
l = D("l")
n = E("n")
a = F("a")
g = D("g")
e = C("e")

d.t = a
d.r = g
j.p = a
j.w = l
j.s = b
b.t = a
b.z = a
b.p = e
b.y = l
b.u = n
l.w = a
n.x = l
n.p = l
n.r = a
a.y = l
a.q = n
a.r = b
g.w = a
e.t = a
e.z = a
e.p = b
e.y = g
e.u = n
assert e.u.p.w.q.r.q.x.w.txt == "a"