class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: D = None
        self.p: D = None
        self.o: E = None
        self.y: E = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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