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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

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

c = A("c")
k = B("k")
j = C("j")
m = D("m")
n = E("n")
l = F("l")
f = E("f")
g = F("g")
h = A("h")

c.v = m
c.z = l
c.q = j
c.y = n
c.x = h
k.y = l
j.r = k
j.w = k
j.t = k
j.q = l
j.x = m
j.u = h
m.v = k
m.z = k
m.q = j
m.r = f
n.r = m
n.y = c
n.u = k
l.o = g
f.r = m
f.y = h
f.u = k
g.o = l
h.v = m
h.z = g
h.q = j
h.y = n
h.x = c
assert c.z.o.o.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: F = None
        self.q: C = None
        self.y: E = None
        self.x: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

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

c = A("c")
k = B("k")
j = C("j")
m = D("m")
n = E("n")
l = F("l")
f = E("f")
g = F("g")
h = A("h")

c.v = m
c.z = l
c.q = j
c.y = n
c.x = h
k.y = l
j.r = k
j.w = k
j.t = k
j.q = l
j.x = m
j.u = h
m.v = k
m.z = k
m.q = j
m.r = f
n.r = m
n.y = c
n.u = k
l.o = g
f.r = m
f.y = h
f.u = k
g.o = l
h.v = m
h.z = g
h.q = j
h.y = n
h.x = c
assert c.z.o.o.o.o.o.o.txt == "l"