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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.z: B = None
        self.r: E = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: F = None
        self.y: F = None
        self.u: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.z: B = None
        self.r: E = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: F = None
        self.y: F = None
        self.u: B = None
        self.x: D = None
        self.txt = txt

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

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

c.r = a
c.w = g
c.v = d
c.s = d
c.p = b
a.q = d
g.y = b
g.p = c
g.x = c
g.z = a
g.r = e
g.v = e
b.y = e
b.p = e
b.t = a
b.q = a
b.v = k
l.q = c
l.o = d
l.y = d
l.u = a
l.x = b
d.z = k
d.p = a
e.q = c
e.o = d
e.y = d
e.u = a
e.x = b
k.y = b
k.p = c
k.x = c
k.z = a
k.r = l
k.v = e
assert d.z.x.p.txt == "b"