class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: D = None
        self.x: C = None
        self.t: G = None
        self.p: D = None
        self.y: C = None
        self.s: C = None
        self.q: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.t: A = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: E = None
        self.o: E = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: G = None
        self.q: E = None
        self.v: H = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.t: A = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: E = None
        self.o: E = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: G = None
        self.q: E = None
        self.v: H = None
        self.x: E = None
        self.txt = txt

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

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