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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

l = A("l")
e = B("e")
i = C("i")
g = D("g")
d = E("d")
c = A("c")
m = D("m")
b = C("b")
f = B("f")

l.x = c
l.u = c
l.v = c
e.s = d
e.q = c
i.z = c
i.u = f
i.y = d
g.x = f
d.t = i
c.x = l
c.u = l
c.v = l
m.x = f
b.z = c
b.u = f
b.y = d
f.s = d
f.q = c
assert l.u.x.v.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: A = None
        self.v: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

l = A("l")
e = B("e")
i = C("i")
g = D("g")
d = E("d")
c = A("c")
m = D("m")
b = C("b")
f = B("f")

l.x = c
l.u = c
l.v = c
e.s = d
e.q = c
i.z = c
i.u = f
i.y = d
g.x = f
d.t = i
c.x = l
c.u = l
c.v = l
m.x = f
b.z = c
b.u = f
b.y = d
f.s = d
f.q = c
assert l.u.x.v.v.u.txt == "c"