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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.z: F = None
        self.q: A = None
        self.s: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: A = None
        self.t: B = None
        self.z: B = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: C = None
        self.z: F = None
        self.q: A = None
        self.s: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: A = None
        self.t: B = None
        self.z: B = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: D = None
        self.txt = txt

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

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

j.s = l
j.x = l
j.q = l
j.p = n
j.y = d
m.r = j
m.q = j
m.x = l
m.z = a
m.s = g
l.u = d
l.t = j
l.r = a
l.y = g
d.x = l
d.v = j
d.t = m
d.z = m
d.u = g
n.y = j
n.v = d
a.r = j
a.s = n
a.q = d
a.z = l
a.o = l
a.t = l
g.r = j
g.q = j
g.x = l
g.z = a
g.s = m
assert g.s.z.r.p.v.z.s.txt == "g"