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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: F = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: F = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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