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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: A = None
        self.s: C = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: B = None
        self.q: E = None
        self.y: B = None
        self.z: F = None
        self.s: A = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: G = None
        self.u: C = None
        self.txt = txt

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

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

d = A("d")
b = B("b")
h = C("h")
f = D("f")
l = E("l")
e = F("e")
i = G("i")
m = D("m")
c = B("c")

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: A = None
        self.s: C = None
        self.p: D = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: B = None
        self.q: E = None
        self.y: B = None
        self.z: F = None
        self.s: A = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: G = None
        self.u: C = None
        self.txt = txt

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

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

d = A("d")
b = B("b")
h = C("h")
f = D("f")
l = E("l")
e = F("e")
i = G("i")
m = D("m")
c = B("c")

d.p = c
b.x = h
b.s = h
b.o = d
b.p = f
b.t = e
h.p = l
h.v = c
h.x = c
f.r = i
f.w = c
f.q = l
f.y = b
f.z = e
f.p = e
f.s = d
l.q = f
l.y = i
l.u = h
e.s = i
i.r = l
i.z = l
i.t = c
i.s = c
m.r = i
m.w = c
m.q = l
m.y = b
m.z = e
m.p = e
m.s = d
c.x = h
c.s = h
c.o = d
c.p = m
c.t = e
assert h.x.s.p.u.p.txt == "l"