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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: F = None
        self.w: A = None
        self.q: E = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: G = None
        self.r: F = None
        self.z: G = None
        self.y: B = None
        self.p: F = None
        self.x: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: A = None
        self.o: B = None
        self.z: A = None
        self.txt = txt

l = A("l")
f = B("f")
i = C("i")
j = D("j")
e = E("e")
n = F("n")
c = G("c")
m = F("m")

l.p = j
l.y = j
l.x = c
f.x = e
f.w = i
i.z = f
j.v = l
j.w = l
j.s = l
j.t = l
j.p = n
j.q = e
e.q = f
e.y = f
e.x = f
e.t = c
e.z = c
e.r = n
e.p = n
n.s = c
n.y = e
n.p = j
n.x = l
n.z = f
c.x = l
c.r = l
c.z = l
c.o = f
m.s = c
m.y = e
m.p = j
m.x = l
m.z = f
assert n.p.s.y.w.y.v.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: G = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: F = None
        self.w: A = None
        self.q: E = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: G = None
        self.r: F = None
        self.z: G = None
        self.y: B = None
        self.p: F = None
        self.x: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: A = None
        self.o: B = None
        self.z: A = None
        self.txt = txt

l = A("l")
f = B("f")
i = C("i")
j = D("j")
e = E("e")
n = F("n")
c = G("c")
m = F("m")

l.p = j
l.y = j
l.x = c
f.x = e
f.w = i
i.z = f
j.v = l
j.w = l
j.s = l
j.t = l
j.p = n
j.q = e
e.q = f
e.y = f
e.x = f
e.t = c
e.z = c
e.r = n
e.p = n
n.s = c
n.y = e
n.p = j
n.x = l
n.z = f
c.x = l
c.r = l
c.z = l
c.o = f
m.s = c
m.y = e
m.p = j
m.x = l
m.z = f
assert n.p.s.y.w.y.v.p.v.txt == "l"