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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: B = None
        self.txt = txt

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

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

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

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

d.v = g
d.q = a
d.t = h
d.o = j
d.u = m
j.z = m
j.o = c
g.s = j
g.t = j
c.y = j
c.z = j
l.v = g
l.s = m
m.p = d
m.z = d
m.u = d
m.v = g
a.v = g
a.q = d
a.t = l
a.o = j
a.u = m
h.v = g
h.s = m
assert h.s.v.s.o.y.o.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: A = None
        self.t: E = None
        self.o: B = None
        self.u: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: B = None
        self.txt = txt

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

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

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

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

d.v = g
d.q = a
d.t = h
d.o = j
d.u = m
j.z = m
j.o = c
g.s = j
g.t = j
c.y = j
c.z = j
l.v = g
l.s = m
m.p = d
m.z = d
m.u = d
m.v = g
a.v = g
a.q = d
a.t = l
a.o = j
a.u = m
h.v = g
h.s = m
assert h.s.v.s.o.y.o.y.z.txt == "m"