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

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

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

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

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

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

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

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

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

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

l.y = f
l.o = b
f.t = b
f.o = b
f.v = l
f.u = g
a.u = f
a.x = k
a.p = g
k.y = l
k.o = g
g.t = b
g.o = a
g.v = l
g.u = f
i.y = l
i.o = f
b.u = f
b.p = f
b.x = i
assert k.y.y.u.t.u.t.x.txt == "i"