class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: H = None
        self.t: I = None
        self.r: I = None
        self.p: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: G = None
        self.r: G = None
        self.t: A = None
        self.p: C = None
        self.x: B = None
        self.q: B = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.y: H = None
        self.txt = txt

b = A("b")
k = B("k")
f = C("f")
e = D("e")
c = E("c")
g = F("g")
m = G("m")
l = H("l")
n = I("n")
d = C("d")

b.r = g
k.o = g
k.t = g
k.u = e
f.s = b
f.o = l
f.p = l
f.t = n
f.r = n
e.t = d
e.v = c
c.u = d
c.o = g
g.s = b
g.t = b
g.w = m
g.r = m
g.p = d
g.x = k
g.q = k
g.o = k
m.x = b
l.x = b
l.q = e
l.s = d
l.z = c
n.w = e
n.q = d
n.y = l
d.s = b
d.o = l
d.p = l
d.t = n
d.r = n
assert d.p.x.r.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: H = None
        self.t: I = None
        self.r: I = None
        self.p: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: G = None
        self.r: G = None
        self.t: A = None
        self.p: C = None
        self.x: B = None
        self.q: B = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.y: H = None
        self.txt = txt

b = A("b")
k = B("k")
f = C("f")
e = D("e")
c = E("c")
g = F("g")
m = G("m")
l = H("l")
n = I("n")
d = C("d")

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