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

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

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

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

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

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

n = A("n")
l = B("l")
j = C("j")
m = D("m")
h = E("h")
f = F("f")
k = A("k")

n.w = h
n.q = h
n.s = f
n.z = f
n.p = j
l.t = j
l.z = j
l.o = m
j.y = f
m.q = k
m.t = j
h.v = j
f.s = h
f.v = m
k.w = h
k.q = h
k.s = f
k.z = f
k.p = j
assert h.v.y.v.q.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: F = None
        self.q: E = None
        self.p: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

n = A("n")
l = B("l")
j = C("j")
m = D("m")
h = E("h")
f = F("f")
k = A("k")

n.w = h
n.q = h
n.s = f
n.z = f
n.p = j
l.t = j
l.z = j
l.o = m
j.y = f
m.q = k
m.t = j
h.v = j
f.s = h
f.v = m
k.w = h
k.q = h
k.s = f
k.z = f
k.p = j
assert h.v.y.v.q.p.y.txt == "f"