class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: F = None
        self.v: F = None
        self.s: F = None
        self.t: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.q: F = None
        self.r: E = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.q: F = None
        self.r: E = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

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