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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

h.q = l
h.t = l
h.w = d
h.o = c
h.v = c
d.r = l
d.q = n
b.z = l
b.y = n
b.q = n
n.u = c
n.y = b
l.t = b
l.u = n
e.t = l
e.q = h
c.q = l
c.t = l
c.w = d
c.o = h
c.v = h
assert d.r.u.u.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: B = None
        self.t: E = None
        self.o: A = None
        self.v: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

h.q = l
h.t = l
h.w = d
h.o = c
h.v = c
d.r = l
d.q = n
b.z = l
b.y = n
b.q = n
n.u = c
n.y = b
l.t = b
l.u = n
e.t = l
e.q = h
c.q = l
c.t = l
c.w = d
c.o = h
c.v = h
assert d.r.u.u.v.q.txt == "l"