class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: G = None
        self.q: C = None
        self.x: E = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: A = None
        self.y: A = None
        self.x: A = None
        self.o: B = None
        self.w: G = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: B = None
        self.x: B = None
        self.t: B = None
        self.v: B = None
        self.q: E = None
        self.w: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: A = None
        self.y: A = None
        self.x: A = None
        self.o: B = None
        self.w: G = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: B = None
        self.x: B = None
        self.t: B = None
        self.v: B = None
        self.q: E = None
        self.w: A = None
        self.txt = txt

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

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