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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: B = None
        self.x: A = None
        self.p: F = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: B = None
        self.x: A = None
        self.p: F = None
        self.w: F = None
        self.txt = txt

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

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