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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: D = None
        self.v: A = None
        self.z: C = None
        self.w: D = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: G = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: F = None
        self.y: F = None
        self.x: F = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: D = None
        self.v: A = None
        self.z: C = None
        self.w: D = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: G = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: F = None
        self.y: F = None
        self.x: F = None
        self.t: C = None
        self.txt = txt

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

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

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

b.r = j
b.x = j
f.p = j
f.x = i
f.w = i
f.v = b
f.z = l
f.t = l
l.w = d
l.s = j
i.r = b
i.q = g
i.s = f
j.r = i
j.o = d
j.y = d
j.x = d
j.t = l
d.s = l
g.w = l
g.s = l
g.t = b
g.o = i
assert j.r.s.t.w.s.s.txt == "j"