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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: G = None
        self.z: C = None
        self.s: C = None
        self.t: E = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: G = None
        self.o: B = None
        self.p: B = None
        self.v: F = None
        self.r: D = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: B = None
        self.r: D = None
        self.q: C = None
        self.v: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: E = None
        self.s: C = None
        self.v: A = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: G = None
        self.z: C = None
        self.s: C = None
        self.t: E = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: G = None
        self.o: B = None
        self.p: B = None
        self.v: F = None
        self.r: D = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: B = None
        self.r: D = None
        self.q: C = None
        self.v: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: E = None
        self.s: C = None
        self.v: A = None
        self.x: C = None
        self.txt = txt

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

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