class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: C = None
        self.x: F = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: C = None
        self.x: F = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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