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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.w: B = None
        self.r: D = None
        self.txt = txt

a = A("a")
f = B("f")
l = C("l")
g = D("g")
d = B("d")
k = D("k")
j = A("j")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.w: B = None
        self.r: D = None
        self.txt = txt

a = A("a")
f = B("f")
l = C("l")
g = D("g")
d = B("d")
k = D("k")
j = A("j")

a.t = l
a.x = g
a.y = g
a.z = f
f.x = l
f.q = l
l.y = g
g.p = d
g.w = d
g.o = k
g.r = k
d.x = l
d.q = l
k.p = f
k.w = f
k.o = g
k.r = g
j.t = l
j.x = g
j.z = f
j.y = k
assert a.t.y.w.q.y.p.q.txt == "l"