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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: E = None
        self.txt = txt

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

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

d = A("d")
f = B("f")
j = C("j")
m = D("m")
k = E("k")
n = F("n")
h = F("h")
g = B("g")
b = F("b")
e = C("e")

d.p = j
d.q = g
d.y = k
d.t = e
d.w = f
f.y = e
f.p = n
f.w = h
f.x = j
j.q = d
j.s = k
j.z = k
j.t = g
j.o = g
j.u = g
m.u = b
m.y = k
k.r = g
n.x = d
n.s = d
n.w = f
n.r = m
n.p = k
h.x = d
h.s = d
h.w = g
h.r = m
h.p = k
g.y = j
g.p = h
g.w = b
g.x = e
b.x = d
b.s = d
b.w = g
b.r = m
b.p = k
e.q = d
e.s = k
e.z = k
e.t = f
e.o = f
e.u = g
assert n.r.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.y: E = None
        self.t: C = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: E = None
        self.txt = txt

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

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

d = A("d")
f = B("f")
j = C("j")
m = D("m")
k = E("k")
n = F("n")
h = F("h")
g = B("g")
b = F("b")
e = C("e")

d.p = j
d.q = g
d.y = k
d.t = e
d.w = f
f.y = e
f.p = n
f.w = h
f.x = j
j.q = d
j.s = k
j.z = k
j.t = g
j.o = g
j.u = g
m.u = b
m.y = k
k.r = g
n.x = d
n.s = d
n.w = f
n.r = m
n.p = k
h.x = d
h.s = d
h.w = g
h.r = m
h.p = k
g.y = j
g.p = h
g.w = b
g.x = e
b.x = d
b.s = d
b.w = g
b.r = m
b.p = k
e.q = d
e.s = k
e.z = k
e.t = f
e.o = f
e.u = g
assert n.r.y.r.txt == "g"