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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

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

m = A("m")
n = B("n")
a = C("a")
b = D("b")
h = E("h")
i = F("i")
f = D("f")
d = B("d")
k = F("k")

m.v = n
n.p = h
a.r = f
a.s = f
a.o = f
a.w = i
a.v = k
a.p = d
b.y = i
b.w = d
b.v = f
b.p = k
h.w = a
h.z = i
h.q = f
i.y = a
i.w = a
i.s = a
i.o = n
i.z = k
i.r = m
f.y = i
f.w = n
f.v = b
f.p = k
d.p = h
k.y = a
k.w = a
k.s = a
k.o = n
k.z = i
k.r = m
assert f.v.v.p.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

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

m = A("m")
n = B("n")
a = C("a")
b = D("b")
h = E("h")
i = F("i")
f = D("f")
d = B("d")
k = F("k")

m.v = n
n.p = h
a.r = f
a.s = f
a.o = f
a.w = i
a.v = k
a.p = d
b.y = i
b.w = d
b.v = f
b.p = k
h.w = a
h.z = i
h.q = f
i.y = a
i.w = a
i.s = a
i.o = n
i.z = k
i.r = m
f.y = i
f.w = n
f.v = b
f.p = k
d.p = h
k.y = a
k.w = a
k.s = a
k.o = n
k.z = i
k.r = m
assert f.v.v.p.o.p.txt == "h"