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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: A = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: A = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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