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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: A = None
        self.o: B = None
        self.x: E = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: A = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: A = None
        self.o: B = None
        self.x: E = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: A = None
        self.t: D = None
        self.txt = txt

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

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