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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: D = None
        self.w: A = None
        self.s: E = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.p: E = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: D = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: D = None
        self.w: A = None
        self.s: E = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.p: E = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: D = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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