class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: F = None
        self.p: D = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: G = None
        self.r: C = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: F = None
        self.p: D = None
        self.z: B = None
        self.x: C = None
        self.v: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: G = None
        self.x: G = None
        self.r: C = None
        self.u: F = None
        self.txt = txt

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

i.r = l
i.t = l
i.u = h
i.p = n
d.x = n
d.z = l
d.r = f
d.u = k
f.r = b
g.r = e
g.z = e
g.q = h
g.p = n
g.x = f
g.v = i
k.x = n
k.r = i
h.t = g
h.y = g
h.w = e
h.z = b
l.y = h
l.u = h
l.t = b
l.x = b
l.r = f
n.r = d
n.z = d
n.q = h
n.p = g
n.x = f
n.v = i
e.x = n
e.z = l
e.r = f
e.u = k
b.y = h
b.u = h
b.t = l
b.x = l
b.r = f
assert b.r.r.u.w.u.x.q.z.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: F = None
        self.p: D = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: G = None
        self.r: C = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: F = None
        self.p: D = None
        self.z: B = None
        self.x: C = None
        self.v: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: G = None
        self.x: G = None
        self.r: C = None
        self.u: F = None
        self.txt = txt

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

i.r = l
i.t = l
i.u = h
i.p = n
d.x = n
d.z = l
d.r = f
d.u = k
f.r = b
g.r = e
g.z = e
g.q = h
g.p = n
g.x = f
g.v = i
k.x = n
k.r = i
h.t = g
h.y = g
h.w = e
h.z = b
l.y = h
l.u = h
l.t = b
l.x = b
l.r = f
n.r = d
n.z = d
n.q = h
n.p = g
n.x = f
n.v = i
e.x = n
e.z = l
e.r = f
e.u = k
b.y = h
b.u = h
b.t = l
b.x = l
b.r = f
assert b.r.r.u.w.u.x.q.z.x.x.txt == "b"