class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: D = None
        self.v: A = None
        self.x: A = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: G = None
        self.x: A = None
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: G = None
        self.x: G = None
        self.p: I = None
        self.u: D = None
        self.o: D = None
        self.w: G = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: D = None
        self.w: D = None
        self.q: B = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: E = None
        self.q: D = None
        self.u: H = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: C = None
        self.u: I = None
        self.q: D = None
        self.o: A = None
        self.x: C = None
        self.r: F = None
        self.s: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: F = None
        self.u: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: D = None
        self.v: A = None
        self.x: A = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: G = None
        self.x: A = None
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: G = None
        self.x: G = None
        self.p: I = None
        self.u: D = None
        self.o: D = None
        self.w: G = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: D = None
        self.w: D = None
        self.q: B = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: E = None
        self.q: D = None
        self.u: H = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: C = None
        self.u: I = None
        self.q: D = None
        self.o: A = None
        self.x: C = None
        self.r: F = None
        self.s: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: F = None
        self.u: G = None
        self.txt = txt

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

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