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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: E = None
        self.p: G = None
        self.o: G = None
        self.w: H = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: B = None
        self.q: D = None
        self.z: B = None
        self.o: D = None
        self.w: A = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: H = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: H = None
        self.x: B = None
        self.u: E = None
        self.v: C = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: G = None
        self.r: C = None
        self.o: E = None
        self.txt = txt

b = A("b")
f = B("f")
e = C("e")
j = D("j")
h = E("h")
l = F("l")
n = G("n")
c = H("c")
d = E("d")

b.q = l
b.r = e
f.s = e
f.v = d
f.p = n
f.o = n
f.w = c
f.t = l
e.s = f
e.v = f
e.z = f
e.q = j
e.o = j
e.w = b
e.r = c
j.u = b
j.v = l
h.z = d
h.p = b
h.t = b
h.y = f
l.r = n
l.v = c
l.z = j
n.z = e
n.v = e
n.y = e
n.w = c
n.x = f
n.u = d
c.y = n
c.x = n
c.r = e
c.o = d
d.z = h
d.p = b
d.t = b
d.y = f
assert n.y.o.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: E = None
        self.p: G = None
        self.o: G = None
        self.w: H = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: B = None
        self.q: D = None
        self.z: B = None
        self.o: D = None
        self.w: A = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: H = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: H = None
        self.x: B = None
        self.u: E = None
        self.v: C = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: G = None
        self.r: C = None
        self.o: E = None
        self.txt = txt

b = A("b")
f = B("f")
e = C("e")
j = D("j")
h = E("h")
l = F("l")
n = G("n")
c = H("c")
d = E("d")

b.q = l
b.r = e
f.s = e
f.v = d
f.p = n
f.o = n
f.w = c
f.t = l
e.s = f
e.v = f
e.z = f
e.q = j
e.o = j
e.w = b
e.r = c
j.u = b
j.v = l
h.z = d
h.p = b
h.t = b
h.y = f
l.r = n
l.v = c
l.z = j
n.z = e
n.v = e
n.y = e
n.w = c
n.x = f
n.u = d
c.y = n
c.x = n
c.r = e
c.o = d
d.z = h
d.p = b
d.t = b
d.y = f
assert n.y.o.u.q.txt == "l"