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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: B = None
        self.s: F = None
        self.t: E = None
        self.x: B = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

b.p = m
h.r = m
h.o = l
h.x = l
h.s = g
h.t = n
h.z = f
m.z = d
e.q = k
e.r = g
n.x = g
n.v = g
g.v = h
k.p = m
l.r = d
l.o = h
l.x = h
l.s = g
l.t = n
l.z = f
d.z = m
f.v = h
assert f.v.z.v.o.s.v.z.v.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: B = None
        self.s: F = None
        self.t: E = None
        self.x: B = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

b.p = m
h.r = m
h.o = l
h.x = l
h.s = g
h.t = n
h.z = f
m.z = d
e.q = k
e.r = g
n.x = g
n.v = g
g.v = h
k.p = m
l.r = d
l.o = h
l.x = h
l.s = g
l.t = n
l.z = f
d.z = m
f.v = h
assert f.v.z.v.o.s.v.z.v.s.v.txt == "h"