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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: F = None
        self.o: C = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: G = None
        self.txt = txt

m = A("m")
l = B("l")
j = C("j")
n = D("n")
i = E("i")
f = F("f")
e = G("e")
c = D("c")
k = C("k")
b = G("b")

m.u = i
l.v = i
j.q = i
j.o = m
j.y = c
j.z = l
n.u = m
n.w = k
n.z = l
i.v = n
i.q = f
i.o = k
i.r = l
f.v = e
f.w = m
e.z = i
e.y = b
c.u = m
c.w = k
c.z = l
k.q = i
k.o = m
k.y = n
k.z = l
b.z = i
b.y = e
assert c.u.u.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: F = None
        self.o: C = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: G = None
        self.txt = txt

m = A("m")
l = B("l")
j = C("j")
n = D("n")
i = E("i")
f = F("f")
e = G("e")
c = D("c")
k = C("k")
b = G("b")

m.u = i
l.v = i
j.q = i
j.o = m
j.y = c
j.z = l
n.u = m
n.w = k
n.z = l
i.v = n
i.q = f
i.o = k
i.r = l
f.v = e
f.w = m
e.z = i
e.y = b
c.u = m
c.w = k
c.z = l
k.q = i
k.o = m
k.y = n
k.z = l
b.z = i
b.y = e
assert c.u.u.v.z.txt == "l"