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

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

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

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

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

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

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

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

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

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

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

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

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

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

f.p = k
f.z = c
f.r = c
h.r = e
h.y = f
h.v = l
k.q = c
k.r = f
k.y = h
k.w = h
k.x = m
k.v = l
l.v = h
l.o = m
c.z = h
c.x = h
c.y = b
c.q = l
b.s = m
e.p = m
e.z = c
e.r = c
m.q = c
m.r = f
m.y = h
m.w = h
m.x = k
m.v = l
assert m.r.p.y.v.o.v.txt == "l"