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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: E = None
        self.r: A = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.y: B = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: E = None
        self.v: D = None
        self.txt = txt

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

l.w = k
h.v = n
h.o = a
h.r = l
h.z = j
j.t = k
m.x = a
m.r = a
m.y = d
m.v = c
m.t = e
a.q = m
a.r = n
k.q = e
k.v = e
k.p = a
e.x = a
e.r = a
e.y = d
e.v = h
e.t = m
d.v = n
d.o = a
d.r = l
d.z = j
n.t = k
c.v = n
c.o = a
c.r = l
c.z = j
assert m.t.t.v.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: E = None
        self.r: A = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.y: B = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: E = None
        self.v: D = None
        self.txt = txt

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

l.w = k
h.v = n
h.o = a
h.r = l
h.z = j
j.t = k
m.x = a
m.r = a
m.y = d
m.v = c
m.t = e
a.q = m
a.r = n
k.q = e
k.v = e
k.p = a
e.x = a
e.r = a
e.y = d
e.v = h
e.t = m
d.v = n
d.o = a
d.r = l
d.z = j
n.t = k
c.v = n
c.o = a
c.r = l
c.z = j
assert m.t.t.v.v.t.txt == "k"