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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: A = None
        self.w: E = None
        self.z: F = None
        self.txt = txt

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

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

f = A("f")
g = B("g")
j = C("j")
m = D("m")
b = E("b")
e = F("e")
l = G("l")
h = E("h")
a = F("a")

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: A = None
        self.w: E = None
        self.z: F = None
        self.txt = txt

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

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

f = A("f")
g = B("g")
j = C("j")
m = D("m")
b = E("b")
e = F("e")
l = G("l")
h = E("h")
a = F("a")

f.p = g
f.y = g
f.t = g
g.s = f
j.q = f
m.x = l
m.q = h
m.o = f
m.r = g
b.p = f
b.y = f
b.w = h
b.z = e
e.t = j
e.z = j
e.o = f
e.r = b
e.y = l
l.u = g
l.p = h
l.t = h
l.y = f
l.r = m
h.p = f
h.y = f
h.w = b
h.z = e
a.t = j
a.z = j
a.o = f
a.r = h
a.y = l
assert g.s.p.s.p.s.t.txt == "g"