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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: A = None
        self.w: B = None
        self.txt = txt

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

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

a = A("a")
j = B("j")
i = C("i")
e = D("e")
f = E("f")
g = F("g")
c = C("c")
h = F("h")

a.u = j
j.y = g
j.o = f
i.t = f
i.u = a
e.s = i
e.z = a
e.w = j
f.q = a
f.u = a
f.o = j
f.y = i
g.w = a
g.o = i
c.t = f
c.u = a
h.w = a
h.o = c
assert g.o.t.y.t.q.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: A = None
        self.w: B = None
        self.txt = txt

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

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

a = A("a")
j = B("j")
i = C("i")
e = D("e")
f = E("f")
g = F("g")
c = C("c")
h = F("h")

a.u = j
j.y = g
j.o = f
i.t = f
i.u = a
e.s = i
e.z = a
e.w = j
f.q = a
f.u = a
f.o = j
f.y = i
g.w = a
g.o = i
c.t = f
c.u = a
h.w = a
h.o = c
assert g.o.t.y.t.q.u.y.txt == "g"