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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: E = None
        self.x: A = None
        self.p: E = None
        self.z: H = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: D = None
        self.t: B = None
        self.w: A = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: E = None
        self.x: A = None
        self.p: E = None
        self.z: H = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: D = None
        self.t: B = None
        self.w: A = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.txt = txt

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

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

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