class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: D = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: B = None
        self.v: A = None
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: B = None
        self.s: E = None
        self.o: C = None
        self.p: C = None
        self.q: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: D = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: B = None
        self.v: A = None
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: B = None
        self.s: E = None
        self.o: C = None
        self.p: C = None
        self.q: B = None
        self.txt = txt

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

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