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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: B = None
        self.v: A = None
        self.x: G = None
        self.p: G = None
        self.q: G = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: B = None
        self.v: A = None
        self.x: G = None
        self.p: G = None
        self.q: G = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

f.v = e
l.r = j
l.w = b
l.v = f
l.x = m
l.p = m
l.q = m
l.o = c
i.y = d
i.o = f
i.r = b
i.p = b
c.x = l
c.q = i
c.p = d
e.s = l
e.v = b
j.u = l
m.y = e
d.u = l
b.r = d
b.w = l
b.v = f
b.x = m
b.p = m
b.q = m
b.o = c
assert d.u.v.v.v.v.v.txt == "e"