class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: A = None
        self.t: E = None
        self.s: F = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: A = None
        self.t: E = None
        self.s: F = None
        self.u: B = None
        self.txt = txt

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

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

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

m.w = i
m.y = h
i.v = h
i.x = f
n.u = m
n.o = m
n.p = m
n.q = i
n.r = f
c.x = f
c.s = f
c.p = m
c.t = h
c.u = i
h.w = f
h.u = n
f.z = m
f.u = m
k.x = f
k.s = f
k.p = m
k.t = h
k.u = i
assert i.x.u.w.x.u.w.x.txt == "f"