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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.v: A = None
        self.q: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.v: A = None
        self.q: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

n.s = b
j.s = g
j.u = n
j.v = n
j.q = b
j.t = b
a.q = g
a.x = j
a.p = j
a.t = b
g.u = a
g.y = j
g.q = j
b.z = j
b.u = j
d.s = a
d.t = c
d.x = c
d.r = g
d.w = g
d.z = n
c.s = a
c.t = d
c.x = d
c.r = g
c.w = g
c.z = n
assert j.t.u.t.u.u.s.u.txt == "j"