class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: C = None
        self.o: D = 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.o: D = None
        self.t: D = None
        self.v: B = None
        self.w: A = None
        self.txt = txt

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

c = A("c")
a = B("a")
j = C("j")
k = D("k")
f = C("f")
n = D("n")
b = A("b")

c.u = a
c.y = f
c.o = n
a.x = b
j.o = k
j.t = k
j.v = a
j.w = c
k.s = a
k.t = f
k.o = f
k.q = n
f.o = n
f.t = k
f.v = a
f.w = b
n.s = a
n.t = j
n.o = j
n.q = k
b.u = a
b.y = f
b.o = k
assert f.w.u.x.u.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: C = None
        self.o: D = 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.o: D = None
        self.t: D = None
        self.v: B = None
        self.w: A = None
        self.txt = txt

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

c = A("c")
a = B("a")
j = C("j")
k = D("k")
f = C("f")
n = D("n")
b = A("b")

c.u = a
c.y = f
c.o = n
a.x = b
j.o = k
j.t = k
j.v = a
j.w = c
k.s = a
k.t = f
k.o = f
k.q = n
f.o = n
f.t = k
f.v = a
f.w = b
n.s = a
n.t = j
n.o = j
n.q = k
b.u = a
b.y = f
b.o = k
assert f.w.u.x.u.x.y.txt == "f"