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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: A = None
        self.p: F = None
        self.s: B = None
        self.txt = txt

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

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

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

f = A("f")
l = B("l")
h = C("h")
e = D("e")
d = E("d")
g = F("g")
j = G("j")

f.o = h
f.w = j
f.x = l
f.r = l
f.p = g
f.y = g
l.p = g
l.w = g
l.q = j
l.s = j
l.u = f
l.r = d
h.y = e
e.y = g
e.p = g
e.v = f
e.s = l
d.u = g
d.o = l
d.p = f
g.w = l
g.p = j
g.y = d
j.w = d
j.x = f
j.y = f
j.v = f
assert e.p.y.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: G = None
        self.x: B = None
        self.r: B = None
        self.p: F = None
        self.y: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: A = None
        self.p: F = None
        self.s: B = None
        self.txt = txt

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

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

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

f = A("f")
l = B("l")
h = C("h")
e = D("e")
d = E("d")
g = F("g")
j = G("j")

f.o = h
f.w = j
f.x = l
f.r = l
f.p = g
f.y = g
l.p = g
l.w = g
l.q = j
l.s = j
l.u = f
l.r = d
h.y = e
e.y = g
e.p = g
e.v = f
e.s = l
d.u = g
d.o = l
d.p = f
g.w = l
g.p = j
g.y = d
j.w = d
j.x = f
j.y = f
j.v = f
assert e.p.y.p.y.txt == "g"