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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: A = None
        self.txt = txt

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

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

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