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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: G = None
        self.x: C = None
        self.s: A = None
        self.p: C = None
        self.r: A = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.t: D = None
        self.w: A = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: C = None
        self.t: B = None
        self.x: B = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: G = None
        self.x: C = None
        self.s: A = None
        self.p: C = None
        self.r: A = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.t: D = None
        self.w: A = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: C = None
        self.t: B = None
        self.x: B = None
        self.p: D = None
        self.txt = txt

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

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

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

b.q = f
i.v = k
i.u = d
i.x = f
i.p = f
i.s = b
i.r = b
i.w = b
f.p = c
f.r = b
e.p = h
e.u = h
e.t = n
e.w = b
e.q = k
k.u = f
k.o = f
k.t = i
k.x = i
k.p = n
h.t = b
h.x = f
d.q = e
d.w = i
d.x = n
c.q = n
c.x = n
c.w = i
n.p = h
n.u = h
n.t = e
n.w = b
n.q = k
assert i.u.x.w.txt == "b"