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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: B = None
        self.p: E = None
        self.v: D = None
        self.t: C = None
        self.txt = txt

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

d.q = b
d.u = k
d.p = k
d.t = k
b.y = k
b.t = k
b.p = n
b.w = a
b.u = e
b.q = e
n.w = b
e.u = k
k.t = g
k.r = d
a.r = g
a.q = b
a.p = k
a.v = e
a.t = n
g.q = b
g.u = k
g.p = k
g.t = k
assert d.p.t.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: E = None
        self.p: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: B = None
        self.p: E = None
        self.v: D = None
        self.t: C = None
        self.txt = txt

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

d.q = b
d.u = k
d.p = k
d.t = k
b.y = k
b.t = k
b.p = n
b.w = a
b.u = e
b.q = e
n.w = b
e.u = k
k.t = g
k.r = d
a.r = g
a.q = b
a.p = k
a.v = e
a.t = n
g.q = b
g.u = k
g.p = k
g.t = k
assert d.p.t.q.w.txt == "a"