class A:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: B = None
        self.z: D = None
        self.t: D = None
        self.q: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: I = None
        self.r: D = None
        self.t: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: C = None
        self.q: C = None
        self.v: I = None
        self.w: E = None
        self.o: D = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: A = None
        self.v: I = None
        self.s: D = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: D = None
        self.t: I = None
        self.v: D = None
        self.x: D = None
        self.o: F = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: B = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: I = None
        self.r: D = None
        self.t: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: C = None
        self.q: C = None
        self.v: I = None
        self.w: E = None
        self.o: D = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: A = None
        self.v: I = None
        self.s: D = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: D = None
        self.t: I = None
        self.v: D = None
        self.x: D = None
        self.o: F = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: B = None
        self.q: B = None
        self.txt = txt

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

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