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

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

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

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

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

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

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

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

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

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

g.t = a
g.s = f
g.v = d
a.w = j
a.z = j
a.s = d
a.r = d
d.x = f
d.v = j
k.w = j
l.w = j
f.w = j
e.t = a
e.s = k
e.v = d
j.w = a
j.z = a
j.s = d
j.r = d
assert l.w.r.x.txt == "f"