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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: D = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: B = None
        self.v: A = None
        self.r: A = None
        self.t: A = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

b = A("b")
f = B("f")
j = C("j")
h = D("h")
c = E("c")
k = F("k")
a = G("a")
d = D("d")
g = D("g")

b.x = a
b.q = c
b.o = h
f.t = a
f.y = a
f.s = g
j.o = f
j.s = f
j.v = b
j.r = b
j.t = b
j.w = b
j.q = k
h.u = f
h.o = b
h.w = b
h.t = g
c.t = a
c.y = a
c.x = k
c.u = f
c.r = h
k.s = f
k.t = c
a.x = k
a.r = f
a.o = f
d.u = f
d.o = b
d.w = b
d.t = h
g.u = f
g.o = b
g.w = b
g.t = h
assert a.r.s.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: E = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: D = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: B = None
        self.v: A = None
        self.r: A = None
        self.t: A = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

b = A("b")
f = B("f")
j = C("j")
h = D("h")
c = E("c")
k = F("k")
a = G("a")
d = D("d")
g = D("g")

b.x = a
b.q = c
b.o = h
f.t = a
f.y = a
f.s = g
j.o = f
j.s = f
j.v = b
j.r = b
j.t = b
j.w = b
j.q = k
h.u = f
h.o = b
h.w = b
h.t = g
c.t = a
c.y = a
c.x = k
c.u = f
c.r = h
k.s = f
k.t = c
a.x = k
a.r = f
a.o = f
d.u = f
d.o = b
d.w = b
d.t = h
g.u = f
g.o = b
g.w = b
g.t = h
assert a.r.s.u.s.txt == "g"