class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: A = None
        self.z: A = None
        self.q: D = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.o: A = None
        self.v: A = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: C = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: E = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.w: C = None
        self.y: E = None
        self.txt = txt

g = A("g")
h = B("h")
m = C("m")
f = D("f")
n = E("n")
a = F("a")
e = C("e")
l = A("l")

g.t = l
g.v = l
g.z = l
g.q = f
g.s = n
h.p = m
h.w = g
h.o = g
h.v = g
h.r = a
m.w = h
m.o = e
m.u = n
f.v = l
f.u = n
f.z = m
n.z = h
n.q = e
n.u = f
a.o = g
a.u = l
a.w = e
a.y = n
e.w = h
e.o = m
e.u = n
l.t = g
l.v = g
l.z = g
l.q = f
l.s = n
assert l.t.t.v.s.u.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: A = None
        self.z: A = None
        self.q: D = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.o: A = None
        self.v: A = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: C = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: E = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.w: C = None
        self.y: E = None
        self.txt = txt

g = A("g")
h = B("h")
m = C("m")
f = D("f")
n = E("n")
a = F("a")
e = C("e")
l = A("l")

g.t = l
g.v = l
g.z = l
g.q = f
g.s = n
h.p = m
h.w = g
h.o = g
h.v = g
h.r = a
m.w = h
m.o = e
m.u = n
f.v = l
f.u = n
f.z = m
n.z = h
n.q = e
n.u = f
a.o = g
a.u = l
a.w = e
a.y = n
e.w = h
e.o = m
e.u = n
l.t = g
l.v = g
l.z = g
l.q = f
l.s = n
assert l.t.t.v.s.u.v.t.txt == "g"