class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: F = None
        self.r: B = None
        self.s: D = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: F = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: D = None
        self.w: E = None
        self.p: F = None
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: E = None
        self.txt = txt

i = A("i")
d = B("d")
n = C("n")
j = D("j")
b = E("b")
g = F("g")
c = G("c")
m = C("m")

i.q = d
i.r = d
i.t = g
i.s = j
i.w = n
d.s = m
d.o = g
d.t = n
d.y = n
n.z = g
n.p = g
n.r = g
n.x = j
n.w = b
j.z = b
j.w = d
j.t = d
j.p = g
b.o = m
b.t = c
g.y = j
c.w = i
c.v = b
m.z = g
m.p = g
m.r = g
m.x = j
m.w = b
assert b.o.w.o.p.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: F = None
        self.r: B = None
        self.s: D = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: F = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: D = None
        self.w: E = None
        self.p: F = None
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: E = None
        self.txt = txt

i = A("i")
d = B("d")
n = C("n")
j = D("j")
b = E("b")
g = F("g")
c = G("c")
m = C("m")

i.q = d
i.r = d
i.t = g
i.s = j
i.w = n
d.s = m
d.o = g
d.t = n
d.y = n
n.z = g
n.p = g
n.r = g
n.x = j
n.w = b
j.z = b
j.w = d
j.t = d
j.p = g
b.o = m
b.t = c
g.y = j
c.w = i
c.v = b
m.z = g
m.p = g
m.r = g
m.x = j
m.w = b
assert b.o.w.o.p.y.p.txt == "g"