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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: B = None
        self.s: C = None
        self.v: F = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: C = None
        self.x: D = None
        self.txt = txt

m = A("m")
e = B("e")
c = C("c")
h = D("h")
d = E("d")
k = F("k")
j = A("j")
b = D("b")
l = F("l")

m.v = d
m.s = e
e.z = c
c.z = l
h.r = l
h.u = l
d.y = e
d.q = e
d.s = c
d.t = c
d.v = l
k.q = l
k.o = c
k.x = b
j.v = d
j.s = e
b.r = k
b.u = l
l.q = k
l.o = c
l.x = b
assert h.u.x.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: B = None
        self.s: C = None
        self.v: F = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: C = None
        self.x: D = None
        self.txt = txt

m = A("m")
e = B("e")
c = C("c")
h = D("h")
d = E("d")
k = F("k")
j = A("j")
b = D("b")
l = F("l")

m.v = d
m.s = e
e.z = c
c.z = l
h.r = l
h.u = l
d.y = e
d.q = e
d.s = c
d.t = c
d.v = l
k.q = l
k.o = c
k.x = b
j.v = d
j.s = e
b.r = k
b.u = l
l.q = k
l.o = c
l.x = b
assert h.u.x.r.q.txt == "l"