class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: F = None
        self.t: C = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: A = None
        self.v: E = None
        self.s: A = None
        self.w: H = None
        self.t: D = None
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: E = None
        self.p: G = None
        self.y: D = None
        self.txt = txt

d = A("d")
j = B("j")
e = C("e")
i = D("i")
g = E("g")
l = F("l")
f = G("f")
a = H("a")

d.u = e
d.t = e
d.x = l
d.q = a
j.x = g
e.u = d
e.z = d
e.q = l
e.y = f
e.s = f
e.v = f
e.r = i
e.x = j
i.s = l
i.x = l
i.u = e
g.r = i
g.s = a
l.p = f
l.q = d
l.s = d
l.v = g
l.w = a
l.t = i
l.r = e
f.u = d
f.t = d
f.w = i
a.z = i
a.y = i
a.q = g
a.p = f
assert e.u.u.u.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: F = None
        self.t: C = None
        self.q: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: A = None
        self.v: E = None
        self.s: A = None
        self.w: H = None
        self.t: D = None
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: E = None
        self.p: G = None
        self.y: D = None
        self.txt = txt

d = A("d")
j = B("j")
e = C("e")
i = D("i")
g = E("g")
l = F("l")
f = G("f")
a = H("a")

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