class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: G = None
        self.s: E = None
        self.r: D = None
        self.t: F = None
        self.z: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: B = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: B = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: E = None
        self.txt = txt

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

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