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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: G = None
        self.p: G = None
        self.z: E = None
        self.u: F = None
        self.q: C = None
        self.r: G = None
        self.x: E = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: I = None
        self.t: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: G = None
        self.p: G = None
        self.z: E = None
        self.u: F = None
        self.q: C = None
        self.r: G = None
        self.x: E = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: I = None
        self.t: D = None
        self.txt = txt

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

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

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