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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: A = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: A = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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