class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: C = None
        self.x: E = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

c = A("c")
m = B("m")
j = C("j")
n = D("n")
l = E("l")
d = F("d")
f = G("f")
a = B("a")
b = E("b")

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

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

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

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

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

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

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

c = A("c")
m = B("m")
j = C("j")
n = D("n")
l = E("l")
d = F("d")
f = G("f")
a = B("a")
b = E("b")

c.y = b
c.x = b
c.v = j
c.t = f
m.o = d
m.x = l
m.z = n
m.w = j
j.p = a
j.q = d
j.u = b
n.v = b
n.x = b
n.p = f
l.v = m
d.v = c
d.z = c
d.t = n
d.w = j
d.u = m
f.p = c
f.y = l
f.v = l
f.r = d
a.o = d
a.x = b
a.z = n
a.w = j
b.v = a
assert b.v.o.z.txt == "c"