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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: C = None
        self.w: F = None
        self.q: F = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: G = None
        self.u: F = None
        self.q: C = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: D = None
        self.y: A = None
        self.txt = txt

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

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

h.u = i
j.p = i
j.x = c
j.t = c
j.w = l
j.q = l
c.r = a
c.s = h
c.w = i
a.s = h
a.w = i
a.u = l
a.q = c
a.o = b
b.w = h
b.u = h
b.y = c
b.o = a
l.o = i
l.x = a
l.y = h
i.t = j
i.r = j
i.q = l
g.r = a
g.s = h
g.w = i
assert i.r.q.x.q.s.u.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: C = None
        self.w: F = None
        self.q: F = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: G = None
        self.u: F = None
        self.q: C = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: D = None
        self.y: A = None
        self.txt = txt

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

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

h.u = i
j.p = i
j.x = c
j.t = c
j.w = l
j.q = l
c.r = a
c.s = h
c.w = i
a.s = h
a.w = i
a.u = l
a.q = c
a.o = b
b.w = h
b.u = h
b.y = c
b.o = a
l.o = i
l.x = a
l.y = h
i.t = j
i.r = j
i.q = l
g.r = a
g.s = h
g.w = i
assert i.r.q.x.q.s.u.q.o.txt == "i"