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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: C = None
        self.x: A = None
        self.u: D = None
        self.txt = txt

h = A("h")
k = B("k")
n = C("n")
l = D("l")
i = E("i")
c = F("c")
b = B("b")

h.x = l
h.t = l
h.o = l
h.w = b
k.v = c
k.z = n
k.p = b
n.w = c
l.w = k
l.p = n
i.z = n
i.x = h
i.w = h
i.p = c
c.q = i
c.o = n
c.x = h
c.u = l
b.v = c
b.z = n
b.p = k
assert l.w.z.w.q.p.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: B = None
        self.t: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: C = None
        self.x: A = None
        self.u: D = None
        self.txt = txt

h = A("h")
k = B("k")
n = C("n")
l = D("l")
i = E("i")
c = F("c")
b = B("b")

h.x = l
h.t = l
h.o = l
h.w = b
k.v = c
k.z = n
k.p = b
n.w = c
l.w = k
l.p = n
i.z = n
i.x = h
i.w = h
i.p = c
c.q = i
c.o = n
c.x = h
c.u = l
b.v = c
b.z = n
b.p = k
assert l.w.z.w.q.p.u.w.txt == "k"