class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: E = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

c = A("c")
h = B("h")
b = C("b")
l = D("l")
g = E("g")
f = E("f")
i = A("i")

c.x = b
c.s = b
c.o = g
h.x = f
h.y = c
h.q = i
h.u = l
b.t = h
l.v = h
g.v = l
g.w = b
g.o = b
g.y = i
f.v = l
f.w = b
f.o = b
f.y = i
i.x = b
i.s = b
i.o = g
assert g.w.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: E = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

c = A("c")
h = B("h")
b = C("b")
l = D("l")
g = E("g")
f = E("f")
i = A("i")

c.x = b
c.s = b
c.o = g
h.x = f
h.y = c
h.q = i
h.u = l
b.t = h
l.v = h
g.v = l
g.w = b
g.o = b
g.y = i
f.v = l
f.w = b
f.o = b
f.y = i
i.x = b
i.s = b
i.o = g
assert g.w.t.q.txt == "i"