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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: C = None
        self.r: G = None
        self.t: D = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: B = None
        self.o: G = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: C = None
        self.t: A = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: G = None
        self.u: D = None
        self.v: G = None
        self.w: D = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: C = None
        self.r: G = None
        self.t: D = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: B = None
        self.o: G = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: C = None
        self.t: A = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: G = None
        self.u: D = None
        self.v: G = None
        self.w: D = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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