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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: G = None
        self.o: C = None
        self.r: G = None
        self.v: E = None
        self.w: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: C = None
        self.r: G = None
        self.p: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: G = None
        self.o: C = None
        self.r: G = None
        self.v: E = None
        self.w: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: C = None
        self.r: G = None
        self.p: D = None
        self.txt = txt

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

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

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