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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

m = A("m")
n = B("n")
a = C("a")
g = D("g")
k = E("k")
h = F("h")
l = F("l")
c = A("c")
i = E("i")

m.s = c
m.p = g
n.z = a
n.t = k
n.x = m
a.o = n
a.r = n
a.q = g
a.p = g
a.w = l
a.t = c
g.y = n
g.p = m
g.u = c
g.s = i
g.x = k
k.r = g
h.y = m
l.y = c
c.s = m
c.p = g
i.r = g
assert c.p.u.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

m = A("m")
n = B("n")
a = C("a")
g = D("g")
k = E("k")
h = F("h")
l = F("l")
c = A("c")
i = E("i")

m.s = c
m.p = g
n.z = a
n.t = k
n.x = m
a.o = n
a.r = n
a.q = g
a.p = g
a.w = l
a.t = c
g.y = n
g.p = m
g.u = c
g.s = i
g.x = k
k.r = g
h.y = m
l.y = c
c.s = m
c.p = g
i.r = g
assert c.p.u.s.s.txt == "c"