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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: A = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: D = None
        self.p: D = None
        self.y: C = None
        self.z: G = None
        self.v: A = None
        self.txt = txt

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

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

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

j.u = d
j.s = f
j.r = h
j.q = l
j.x = g
a.x = g
a.q = g
a.p = j
l.p = g
n.v = l
n.w = g
f.w = d
f.x = n
f.p = n
f.y = l
f.z = b
f.v = h
d.r = j
b.x = l
b.p = a
b.s = d
b.u = g
k.r = j
h.u = d
h.s = f
h.r = j
h.q = l
h.x = b
g.x = l
g.p = a
g.s = k
g.u = b
assert d.r.x.s.r.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.r: A = None
        self.q: C = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: A = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: D = None
        self.p: D = None
        self.y: C = None
        self.z: G = None
        self.v: A = None
        self.txt = txt

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

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

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

j.u = d
j.s = f
j.r = h
j.q = l
j.x = g
a.x = g
a.q = g
a.p = j
l.p = g
n.v = l
n.w = g
f.w = d
f.x = n
f.p = n
f.y = l
f.z = b
f.v = h
d.r = j
b.x = l
b.p = a
b.s = d
b.u = g
k.r = j
h.u = d
h.s = f
h.r = j
h.q = l
h.x = b
g.x = l
g.p = a
g.s = k
g.u = b
assert d.r.x.s.r.x.x.txt == "l"