class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

b.s = a
b.o = f
b.y = f
e.x = b
f.t = b
f.u = e
f.p = j
f.v = g
k.p = a
k.y = g
k.z = g
i.x = b
g.p = a
g.y = k
g.z = k
a.t = b
a.u = e
a.p = i
a.v = k
j.x = b
assert g.z.z.p.u.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

b.s = a
b.o = f
b.y = f
e.x = b
f.t = b
f.u = e
f.p = j
f.v = g
k.p = a
k.y = g
k.z = g
i.x = b
g.p = a
g.y = k
g.z = k
a.t = b
a.u = e
a.p = i
a.v = k
j.x = b
assert g.z.z.p.u.x.y.txt == "f"