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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: A = None
        self.y: D = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: A = None
        self.q: F = None
        self.z: A = None
        self.u: A = None
        self.s: B = None
        self.txt = txt

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

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

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

h = A("h")
m = B("m")
n = C("n")
c = D("c")
i = E("i")
j = F("j")
a = E("a")
l = D("l")
g = C("g")

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: A = None
        self.y: D = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: A = None
        self.q: F = None
        self.z: A = None
        self.u: A = None
        self.s: B = None
        self.txt = txt

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

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

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

h = A("h")
m = B("m")
n = C("n")
c = D("c")
i = E("i")
j = F("j")
a = E("a")
l = D("l")
g = C("g")

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