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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: D = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: B = None
        self.p: E = None
        self.v: E = None
        self.y: F = None
        self.w: A = None
        self.txt = txt

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

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

k = A("k")
l = B("l")
f = C("f")
n = D("n")
a = E("a")
h = F("h")
b = A("b")

k.v = h
k.q = h
k.o = h
k.x = n
k.z = a
k.r = b
l.s = b
f.p = b
f.r = n
f.t = l
n.t = h
n.y = h
n.o = l
n.p = a
n.v = a
n.w = k
a.u = l
a.z = l
h.y = f
b.v = h
b.q = h
b.o = h
b.x = n
b.z = a
b.r = k
assert l.s.z.z.s.x.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: D = None
        self.z: E = None
        self.r: A = None
        self.q: F = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: D = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: B = None
        self.p: E = None
        self.v: E = None
        self.y: F = None
        self.w: A = None
        self.txt = txt

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

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

k = A("k")
l = B("l")
f = C("f")
n = D("n")
a = E("a")
h = F("h")
b = A("b")

k.v = h
k.q = h
k.o = h
k.x = n
k.z = a
k.r = b
l.s = b
f.p = b
f.r = n
f.t = l
n.t = h
n.y = h
n.o = l
n.p = a
n.v = a
n.w = k
a.u = l
a.z = l
h.y = f
b.v = h
b.q = h
b.o = h
b.x = n
b.z = a
b.r = k
assert l.s.z.z.s.x.w.v.txt == "h"