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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: G = None
        self.y: G = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: C = None
        self.z: E = None
        self.y: F = None
        self.t: E = None
        self.v: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: G = None
        self.y: G = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: C = None
        self.z: E = None
        self.y: F = None
        self.t: E = None
        self.v: C = None
        self.txt = txt

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

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