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

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

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

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

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

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

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

m.w = d
m.r = j
m.z = j
m.x = b
k.x = j
k.w = j
k.t = d
k.q = m
a.y = m
d.o = k
j.v = d
n.x = b
h.v = d
i.w = d
i.r = j
i.z = j
i.x = b
l.y = i
b.x = n
assert k.q.z.v.o.w.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: E = None
        self.z: E = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

m.w = d
m.r = j
m.z = j
m.x = b
k.x = j
k.w = j
k.t = d
k.q = m
a.y = m
d.o = k
j.v = d
n.x = b
h.v = d
i.w = d
i.r = j
i.z = j
i.x = b
l.y = i
b.x = n
assert k.q.z.v.o.w.v.o.txt == "k"