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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: I = None
        self.z: F = None
        self.x: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: H = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: B = None
        self.s: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: I = None
        self.z: F = None
        self.x: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: H = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: B = None
        self.s: F = None
        self.q: A = None
        self.txt = txt

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

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