class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: B = None
        self.u: F = None
        self.v: F = None
        self.s: E = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: E = None
        self.q: B = None
        self.u: B = None
        self.x: D = None
        self.txt = txt

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

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

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

m = A("m")
i = B("i")
h = C("h")
c = D("c")
b = E("b")
g = F("g")
k = F("k")
j = A("j")
l = E("l")
d = E("d")

m.r = i
m.p = i
m.u = g
m.o = g
m.v = k
m.s = b
i.r = l
i.v = c
i.y = d
h.z = i
h.q = i
h.u = i
h.s = d
h.x = c
c.x = m
c.t = g
c.o = j
c.p = k
b.q = m
b.v = j
g.s = b
g.z = k
g.p = l
k.s = b
k.z = g
k.p = l
j.r = i
j.p = i
j.u = k
j.o = k
j.v = g
j.s = l
l.q = m
l.v = m
d.q = m
d.v = m
assert k.s.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: B = None
        self.u: F = None
        self.v: F = None
        self.s: E = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: E = None
        self.q: B = None
        self.u: B = None
        self.x: D = None
        self.txt = txt

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

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

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

m = A("m")
i = B("i")
h = C("h")
c = D("c")
b = E("b")
g = F("g")
k = F("k")
j = A("j")
l = E("l")
d = E("d")

m.r = i
m.p = i
m.u = g
m.o = g
m.v = k
m.s = b
i.r = l
i.v = c
i.y = d
h.z = i
h.q = i
h.u = i
h.s = d
h.x = c
c.x = m
c.t = g
c.o = j
c.p = k
b.q = m
b.v = j
g.s = b
g.z = k
g.p = l
k.s = b
k.z = g
k.p = l
j.r = i
j.p = i
j.u = k
j.o = k
j.v = g
j.s = l
l.q = m
l.v = m
d.q = m
d.v = m
assert k.s.q.o.txt == "g"