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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: B = None
        self.u: C = None
        self.x: G = None
        self.z: A = None
        self.txt = txt

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

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

b.w = e
b.u = f
i.u = c
i.v = c
i.t = b
i.w = b
i.o = f
m.x = e
m.w = a
m.y = c
a.p = f
a.o = f
a.u = c
e.v = a
f.q = c
f.x = c
f.t = i
f.u = m
f.z = b
c.y = b
assert e.v.u.y.w.v.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: B = None
        self.u: C = None
        self.x: G = None
        self.z: A = None
        self.txt = txt

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

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

b.w = e
b.u = f
i.u = c
i.v = c
i.t = b
i.w = b
i.o = f
m.x = e
m.w = a
m.y = c
a.p = f
a.o = f
a.u = c
e.v = a
f.q = c
f.x = c
f.t = i
f.u = m
f.z = b
c.y = b
assert e.v.u.y.w.v.u.y.txt == "b"