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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: D = None
        self.r: F = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: D = None
        self.r: F = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: E = None
        self.txt = txt

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

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