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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: C = None
        self.y: B = None
        self.s: C = None
        self.r: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: E = None
        self.w: C = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

d = A("d")
n = B("n")
m = C("m")
f = D("f")
a = E("a")
b = F("b")
g = C("g")
k = B("k")
c = A("c")
l = B("l")

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: C = None
        self.y: B = None
        self.s: C = None
        self.r: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: E = None
        self.w: C = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

d = A("d")
n = B("n")
m = C("m")
f = D("f")
a = E("a")
b = F("b")
g = C("g")
k = B("k")
c = A("c")
l = B("l")

d.o = b
d.u = b
d.q = f
d.x = g
n.t = b
n.p = g
n.y = k
n.s = m
n.r = f
n.v = f
m.u = c
m.y = a
m.w = g
m.q = b
f.v = d
a.s = c
a.w = k
b.s = m
g.u = c
g.y = a
g.w = m
g.q = b
k.t = b
k.p = g
k.s = g
k.y = l
k.r = f
k.v = f
c.o = b
c.u = b
c.q = f
c.x = m
l.t = b
l.p = g
l.y = n
l.s = m
l.r = f
l.v = f
assert k.r.v.q.txt == "f"