class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: E = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: E = None
        self.o: B = None
        self.v: B = None
        self.q: B = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: E = None
        self.o: B = None
        self.v: B = None
        self.q: B = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: E = None
        self.txt = txt

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

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