class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: C = None
        self.r: C = None
        self.y: I = None
        self.w: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.o: F = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: I = None
        self.x: C = None
        self.r: C = None
        self.v: D = None
        self.p: D = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.o: F = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: I = None
        self.x: C = None
        self.r: C = None
        self.v: D = None
        self.p: D = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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