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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: E = None
        self.u: C = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: G = None
        self.o: G = None
        self.y: G = None
        self.u: I = None
        self.q: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: E = None
        self.u: C = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: G = None
        self.o: G = None
        self.y: G = None
        self.u: I = None
        self.q: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.txt = txt

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

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