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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: E = None
        self.u: D = None
        self.v: F = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.t: D = None
        self.u: A = None
        self.x: A = None
        self.s: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: E = None
        self.u: D = None
        self.v: F = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.t: D = None
        self.u: A = None
        self.x: A = None
        self.s: E = None
        self.txt = txt

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

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