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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: E = None
        self.t: E = None
        self.txt = txt

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

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

k = A("k")
a = B("a")
j = C("j")
f = D("f")
b = E("b")
g = E("g")

k.x = g
k.y = a
k.p = f
k.q = b
k.r = b
a.t = f
j.o = g
j.t = g
j.w = b
f.x = b
f.v = k
f.q = k
f.r = k
f.z = a
b.t = f
b.s = f
b.q = k
b.x = j
g.t = f
g.s = f
g.q = k
g.x = j
assert g.q.p.z.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: B = None
        self.p: D = None
        self.q: E = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: E = None
        self.t: E = None
        self.txt = txt

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

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

k = A("k")
a = B("a")
j = C("j")
f = D("f")
b = E("b")
g = E("g")

k.x = g
k.y = a
k.p = f
k.q = b
k.r = b
a.t = f
j.o = g
j.t = g
j.w = b
f.x = b
f.v = k
f.q = k
f.r = k
f.z = a
b.t = f
b.s = f
b.q = k
b.x = j
g.t = f
g.s = f
g.q = k
g.x = j
assert g.q.p.z.t.x.txt == "b"