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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.t: C = None
        self.o: D = None
        self.s: D = None
        self.txt = txt

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

h = A("h")
e = B("e")
n = C("n")
k = D("k")
d = E("d")
c = F("c")
l = D("l")
m = F("m")

h.q = m
h.p = d
h.v = c
h.t = l
e.q = n
e.s = d
e.p = d
e.w = c
n.v = l
n.t = h
k.w = d
k.s = d
k.q = h
k.v = e
k.x = e
k.t = m
d.u = e
d.w = c
d.t = n
d.o = l
d.s = l
c.w = h
l.w = d
l.s = d
l.q = h
l.v = e
l.x = e
l.t = m
m.w = h
assert d.s.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: E = None
        self.v: F = None
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: F = None
        self.t: C = None
        self.o: D = None
        self.s: D = None
        self.txt = txt

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

h = A("h")
e = B("e")
n = C("n")
k = D("k")
d = E("d")
c = F("c")
l = D("l")
m = F("m")

h.q = m
h.p = d
h.v = c
h.t = l
e.q = n
e.s = d
e.p = d
e.w = c
n.v = l
n.t = h
k.w = d
k.s = d
k.q = h
k.v = e
k.x = e
k.t = m
d.u = e
d.w = c
d.t = n
d.o = l
d.s = l
c.w = h
l.w = d
l.s = d
l.q = h
l.v = e
l.x = e
l.t = m
m.w = h
assert d.s.q.t.txt == "l"