class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: E = None
        self.u: B = None
        self.z: D = None
        self.y: C = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: C = None
        self.t: G = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: G = None
        self.w: G = None
        self.z: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: C = None
        self.t: G = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: G = None
        self.w: G = None
        self.z: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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