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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.v: E = None
        self.z: C = None
        self.w: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.v: E = None
        self.z: C = None
        self.w: E = None
        self.x: E = None
        self.txt = txt

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

m.w = j
k.v = m
k.y = l
k.z = l
k.x = l
f.v = h
l.q = j
l.z = h
l.w = m
j.o = l
j.w = l
j.y = m
h.y = l
h.s = f
h.v = j
h.w = j
h.x = j
h.z = a
a.v = h
assert a.v.w.o.q.y.w.y.txt == "m"