class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: F = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.s: G = None
        self.p: D = None
        self.w: A = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.s: G = None
        self.p: D = None
        self.w: A = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

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