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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: A = None
        self.z: E = None
        self.t: D = None
        self.txt = txt

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

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

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

c = A("c")
e = B("e")
i = C("i")
l = D("l")
h = E("h")
g = F("g")

c.u = e
c.w = i
c.r = h
e.q = c
e.u = l
i.p = h
i.z = h
i.o = c
i.t = l
l.q = c
l.z = c
l.t = h
l.o = i
l.v = i
h.s = l
h.t = l
g.u = c
g.q = e
g.x = e
g.s = l
assert l.q.w.p.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: C = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: A = None
        self.z: E = None
        self.t: D = None
        self.txt = txt

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

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

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

c = A("c")
e = B("e")
i = C("i")
l = D("l")
h = E("h")
g = F("g")

c.u = e
c.w = i
c.r = h
e.q = c
e.u = l
i.p = h
i.z = h
i.o = c
i.t = l
l.q = c
l.z = c
l.t = h
l.o = i
l.v = i
h.s = l
h.t = l
g.u = c
g.q = e
g.x = e
g.s = l
assert l.q.w.p.t.z.txt == "c"