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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: C = None
        self.p: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: C = None
        self.p: A = None
        self.v: A = None
        self.txt = txt

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

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