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

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

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

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

c = A("c")
f = B("f")
e = C("e")
i = D("i")
j = B("j")
n = B("n")
k = C("k")
d = D("d")
l = C("l")

c.v = e
c.u = d
c.q = d
c.o = k
f.s = i
f.y = j
f.r = c
e.y = c
e.t = c
e.u = j
e.x = i
i.p = j
i.z = c
i.x = f
i.v = k
j.s = d
j.y = n
j.r = c
n.s = i
n.y = f
n.r = c
k.y = c
k.t = c
k.u = n
k.x = i
d.p = j
d.x = j
d.z = c
d.v = e
l.y = c
l.t = c
l.u = n
l.x = i
assert f.y.y.y.s.p.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: D = None
        self.q: D = None
        self.o: C = None
        self.txt = txt

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

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

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

c = A("c")
f = B("f")
e = C("e")
i = D("i")
j = B("j")
n = B("n")
k = C("k")
d = D("d")
l = C("l")

c.v = e
c.u = d
c.q = d
c.o = k
f.s = i
f.y = j
f.r = c
e.y = c
e.t = c
e.u = j
e.x = i
i.p = j
i.z = c
i.x = f
i.v = k
j.s = d
j.y = n
j.r = c
n.s = i
n.y = f
n.r = c
k.y = c
k.t = c
k.u = n
k.x = i
d.p = j
d.x = j
d.z = c
d.v = e
l.y = c
l.t = c
l.u = n
l.x = i
assert f.y.y.y.s.p.r.q.txt == "d"