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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: C = None
        self.x: C = None
        self.w: D = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

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

h = A("h")
k = B("k")
l = C("l")
a = D("a")
e = E("e")
d = F("d")

h.q = e
h.v = l
k.p = h
l.r = a
l.o = h
l.v = d
a.o = e
a.x = d
a.t = d
a.s = h
a.v = h
e.y = k
e.u = l
e.x = l
e.w = a
e.p = d
e.t = h
d.r = l
assert e.w.x.r.r.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: C = None
        self.x: C = None
        self.w: D = None
        self.p: F = None
        self.t: A = None
        self.txt = txt

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

h = A("h")
k = B("k")
l = C("l")
a = D("a")
e = E("e")
d = F("d")

h.q = e
h.v = l
k.p = h
l.r = a
l.o = h
l.v = d
a.o = e
a.x = d
a.t = d
a.s = h
a.v = h
e.y = k
e.u = l
e.x = l
e.w = a
e.p = d
e.t = h
d.r = l
assert e.w.x.r.r.o.u.txt == "l"