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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: D = None
        self.v: G = None
        self.o: F = None
        self.t: G = None
        self.r: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

e = A("e")
c = B("c")
g = C("g")
h = D("h")
m = E("m")
a = F("a")
k = G("k")

e.u = c
e.q = a
e.y = m
c.t = m
c.u = h
g.q = k
g.v = k
g.t = k
g.y = h
g.r = h
g.o = a
h.s = g
m.q = h
m.r = e
m.s = e
m.t = k
a.p = c
a.t = k
a.r = k
a.o = h
a.u = m
a.w = m
a.y = g
k.s = g
assert h.s.r.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: D = None
        self.v: G = None
        self.o: F = None
        self.t: G = None
        self.r: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

e = A("e")
c = B("c")
g = C("g")
h = D("h")
m = E("m")
a = F("a")
k = G("k")

e.u = c
e.q = a
e.y = m
c.t = m
c.u = h
g.q = k
g.v = k
g.t = k
g.y = h
g.r = h
g.o = a
h.s = g
m.q = h
m.r = e
m.s = e
m.t = k
a.p = c
a.t = k
a.r = k
a.o = h
a.u = m
a.w = m
a.y = g
k.s = g
assert h.s.r.s.o.txt == "a"