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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: B = None
        self.w: F = None
        self.u: F = None
        self.z: D = None
        self.y: A = None
        self.r: A = None
        self.q: D = None
        self.o: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.o: A = None
        self.t: H = None
        self.u: D = None
        self.x: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: B = None
        self.w: F = None
        self.u: F = None
        self.z: D = None
        self.y: A = None
        self.r: A = None
        self.q: D = None
        self.o: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.o: A = None
        self.t: H = None
        self.u: D = None
        self.x: G = None
        self.txt = txt

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

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