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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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