class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: E = None
        self.u: A = None
        self.x: A = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

h = A("h")
a = B("a")
n = C("n")
l = D("l")
j = E("j")
f = F("f")
d = B("d")
c = A("c")
g = D("g")

h.p = n
h.z = n
h.y = j
h.u = c
h.x = c
a.r = g
a.u = j
a.z = d
a.v = n
n.p = h
n.z = f
n.w = j
n.y = l
n.o = c
l.r = g
l.y = g
l.w = d
l.u = j
l.x = j
j.x = d
j.s = n
j.o = f
f.s = l
f.v = j
f.p = j
f.t = d
d.r = l
d.u = j
d.z = a
d.v = n
c.p = n
c.z = n
c.y = j
c.u = h
c.x = h
g.r = l
g.y = l
g.w = d
g.u = j
g.x = j
assert g.r.u.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: E = None
        self.u: A = None
        self.x: A = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

h = A("h")
a = B("a")
n = C("n")
l = D("l")
j = E("j")
f = F("f")
d = B("d")
c = A("c")
g = D("g")

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