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

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

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: G = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: F = None
        self.o: G = None
        self.t: G = None
        self.y: A = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: G = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: F = None
        self.o: G = None
        self.t: G = None
        self.y: A = None
        self.z: C = None
        self.txt = txt

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

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