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

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

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

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

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

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

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

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

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

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

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

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

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

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

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