class A:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: F = None
        self.z: E = None
        self.u: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.y: A = None
        self.t: G = None
        self.z: H = None
        self.v: B = None
        self.x: E = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: B = None
        self.r: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: A = None
        self.r: E = None
        self.u: A = None
        self.x: G = None
        self.z: G = None
        self.p: F = None
        self.v: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: F = None
        self.z: E = None
        self.u: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.y: A = None
        self.t: G = None
        self.z: H = None
        self.v: B = None
        self.x: E = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: B = None
        self.r: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: A = None
        self.r: E = None
        self.u: A = None
        self.x: G = None
        self.z: G = None
        self.p: F = None
        self.v: G = None
        self.txt = txt

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

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